<template>
  <div>
    <VMask v-if="isShow"></VMask>
    <transition name="zoom-out"
                enter-active-class="transition-active"
                leave-active-class="transition-active">
    <div v-if="isShow" class="message-remind">
      <div class="m-center">
        <div class="m-cont">{{text}}</div>
        <div class="m-btn" v-click="close">
          关闭
        </div>
      </div>
    </div>
    </transition>
  </div>

</template>

<script>
import VMask from '@/modules/mask'
export default {
  data () {
    return {
      isShow: 0,
      text: ''
    }
  },
  components: {
    VMask
  },
  methods: {
    show ({text}) {
      this.isShow = 1
      this.text = text
    },
    close () {
      this.isShow = 0
    }
  }
}
</script>

<style scoped>
.message-remind {
  position: fixed;
  top:50%;
  left:50%;
  width: 100%;
  transform:translate(-50%,-50%);
  z-index: 9;

  .m-center {
    margin:0 20px;
    background-color: #fff;
    border-radius: 6px;
  }
  .m-cont {
    padding: 22px 18px;
    line-height: 1.6;
    font-size: 15px;
    border-bottom: 1PX solid #ddd;
  }
  .m-btn {
    text-align: center;
    padding:12px 0 16px;
    font-size: 17px;
    color: #007aff;
    &:active{
      opacity: 0.8;
    }
  }
}

.zoom-out-leave-to {
  opacity: 0;
  transform: translate(-50%,-50%) scale(0.8);
}
.zoom-out-enter {
  opacity: 0;
  transform: translate(-50%,-50%) scale(1.2);
}
</style>
